'use strict'

//const fun = require('./function.js');

class ifstar {
  constructor() {
    this.param = '/'
  }

  async get(c) {
    let {user_id,poster_id} = c.query
    let a = c.service.fun;

    c.setHeader('content-type', 'text/html; charset=utf-8')
    let data = await a.sel('follow_list',{"follow_id":user_id,"followed_id":poster_id},[],c.service.pool);
    console.log(data)
    if(data.rows[0] == undefined){
      console.log('wu')
      c.send({
        type:'boolean',
        data:false
      })
    }
    else{
      console.log('you')
      c.send({
        type:'boolean',
        data:true
      })
    }
  }
  
}

module.exports = ifstar;

